package controllers;

import java.util.Date;

import models.User;

public class Security extends controllers.Secure.Security {
    static boolean authenticate(String username, String password) {
    	User user = User.find("from User u where u.password = ? and u.email = ?", password, username).first();
    	boolean ok = user != null;
    	
    	if (ok) {
    		user.setLastLogin(new Date());
    		user.save();
    	}
        return ok;
    }

    static boolean check(String profile) {
        return true;
    }
}
